import React from 'react'
import './style.scss'
import Icon from '@/components/Icon'
type PropTypes = {
  items: any[],
  clickItems: any,
  clickCartIcon: any
}
function Items(props: PropTypes) {
  return (
    <div className='items'>
      {
        props.items.map(
          item => (
            <div className="item" key={item.id} onClick={
              () => {
                props.clickItems(item.id)
              }
            }>
              <img src={item.pic} alt="" className="item-pic" />
              <div className="item-info">
                <h4>{item.name}</h4>
                <div className="item-action">
                  <p className="price">￥{item.minPrice}</p>
                  <Icon name="gouwuchetianjia" size={22}/>
                </div>
              </div>
            </div>
          )
        )
      }
     
    </div>
  )
}

export default Items